package org.lightmtv.generator;

import java.util.Properties;

import org.lightcommons.resource.FileSystemResourceLoader;
import org.lightcommons.resource.ResourceLoader;
import org.lightcommons.template.TemplateFactory;
import org.lightcommons.template.commontemplate.CommonTemplateFactory;
import org.lightcommons.util.EncodingProperties;

public class Config {
	private static Properties prop = EncodingProperties.loadFromClassPath("org/lightmtv/generator/test.conf", "utf-8");
	private static TemplateFactory factory;
	private static String home;
	private static String templateRoot;
	static{
		home = prop.getProperty("test.home").replace('\\', '/');
		System.out.println("Test Home is "+home);
		templateRoot = home+"/src/test/resources/template";
		ResourceLoader loader = new FileSystemResourceLoader(templateRoot);
		factory = new CommonTemplateFactory();
		factory.setResourceLoader(loader);
	}
	public static String getHome(){
		return home;
	}
	
	public static String getTemplateRoot() {
		return templateRoot;
	}
	
	public static TemplateFactory getTemplateFactory(){
		return factory;
	}
}
